import VueRouter from "vue-router";
import HomeTest from "../page/home.vue";
import AboutTest from "../page/about.vue";
import MessageTest from "../page/message.vue";
import NewsTest from "../page/news.vue";
import DetailTest from "../page/detail.vue";
export default new VueRouter({
    routes:[
        {
            path:"/about",
            component:AboutTest
        },
            {
                path:"/home",
                component:HomeTest,
                children:[
                    {
                        path:"message", 
                        component:MessageTest,
                        children:[
                            {
                                name:"detail",
                                path:"detail/:id/:title",
                                component:DetailTest,
                                props($route){
                                    return{
                                        id:$route.query.id,
                                        title:$route.query.title
                                    }
                                }
                            }
                        ]
                    },
                    {
                        path:"news",
                        component:NewsTest,
                    }
                ]
            }, 
    ]
})